<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html style="background: #eee;">
	<head>
	<meta charset="utf-8">
  <title>修改密码</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="layui/css/layui.css"  media="all">
   <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/common.css">
  <link rel="stylesheet" href="css/myLayui.css">
  <link rel="stylesheet" href="css/mycss.css">
    <link rel="stylesheet" href="css/personal.css">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
	</head>
  <body class="layui-layout-body">
    
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header" style="background:#1E89E0 ">
                   <ul class="layui-nav" style="padding-left: 100px">
             <div class="w">
             <span class="logo" style="margin-right:0px"><img src="img/logo.png" alt=""></span>
		        <li class="layui-nav-item"><a href="is.do">首页</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment01">蔡塘悦舍</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment02">悦舍大院</a></li>
		        <li class="layui-nav-item"><a href="ss.do?op=apartment03">悦舍阔居</a></li>
		        <li class="layui-nav-item"><a href="ts.do?op=query">社区生活</a></li>
		        <li class="layui-nav-item"><a href="is.do?op=about">关于悦舍</a></li>
        <li class="layui-nav-item"><a href="is.do?op=aboutus">关于我们</a></li>
                <li class="layui-nav-item user">
                  <a href=""><img src="<%=request.getAttribute("personImg") %>" class="layui-nav-img"><%=request.getAttribute("personNickName") %></a>
                  <dl class="layui-nav-child">
                      <dd><a href="us.do?op=queryPerson">个人中心</a></dd>
                      <dd><a href="us.do?op=updpwd1">密码修改</a></dd>
                      <dd><a href="us.do?op=removesession">退出</a></dd>
                  </dl>
                  </li>
                  </div>
            </ul>
        </div>
        
        <div class="layui-side layui-bg-black" >

          <div class="layui-side-scroll">
             
            <!-- 头像 -->
            <div class="head-bg">
              <div class="head-pic">
                  <img src="<%=request.getAttribute("personImg") %>" class="layui-nav-img">
              </div>
              <div class="username">昵称：<span><%=request.getAttribute("personNickName") %></span></div>
           
          </div>

            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
              <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">个人信息</a>
                <dl class="layui-nav-child">
                  <dd><a href="us.do?op=queryPerson">我的资料</a></dd>
                  <dd class="layui-this"><a href="us.do?op=updpwd1">修改密码</a></dd>
                </dl>
              </li>
              <li class="layui-nav-item"><a href="us.do?op=queryBypage">查询房租水电</a></li>
              <li class="layui-nav-item"><a href="us.do?op=queryMsg">社区评论</a></li>
              <li class="layui-nav-item"><a href="us.do?op=queryFix">故障报修</a></li>
            </ul>
          </div>
        </div>
        <form class="form-horizontal" action="us.do?op=updpwd" method="post">
        <div class="layui-body">
          <!-- 内容主体区域 -->
          <div class="layui-fluid">
              <div class="layui-row layui-col-space15">
                <div class="layui-col-md8" id="ps_right">
                  <div class="layui-card">
                    <div class="layui-card-header">修改密码</div>
                    <div class="layui-card-body" pad15>
                      
                      <div class="layui-form" lay-filter="">
                        <div class="layui-form-item">
                          <label class="layui-form-label">当前密码</label>
                          <div class="layui-input-inline">
                            <input type="password" name="oldPassword" lay-verify="required" lay-verType="tips" class="layui-input">
                          </div>
                        </div>
                        <div class="layui-form-item">
                          <label class="layui-form-label">新密码</label>
                          <div class="layui-input-inline">
                            <input type="password" name="password" lay-verify="required" lay-verType="tips" autocomplete="off" id="LAY_password" class="layui-input">
                          </div>
                          <div class="layui-form-mid layui-word-aux">6到16个字符</div>
                        </div>
                        <div class="layui-form-item">
                          <label class="layui-form-label">确认新密码</label>
                          <div class="layui-input-inline">
                            <input type="password" name="repassword" lay-verify="required" lay-verType="tips" autocomplete="off" class="layui-input">
                          </div>
                        </div>
                        <div class="layui-form-item">
                          <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="setmypass">确认修改</button>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          
        </div>
        </form>
         <!-- <div class="layui-footer">
         
          © layui.com - 底部固定区域
        </div> -->
      </div>

<script src="layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
   <!-- 个人小菜单 -->
   <script>
      layui.use('element', function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        //监听导航点击
        element.on('.layui-nav', function(elem){
          //console.log(elem)
          layer.msg(elem.text());
        });
      });
      </script>
  <script>
        //Demo
        layui.use('form', function(){
              var form = layui.form;
              
              //监听提交
              form.on('submit(formDemo)', function(data){
                  layer.msg(JSON.stringify(data.field));
                  return false;
              });
              });
      </script>
      
	</body>
	<!-- 修改成功弹窗提示并跳转 -->
	<% if(request.getAttribute("success")!=null){
	  %>
	  <script type="text/javascript">
		  layui.use('layer', function(){
			  var layer = layui.layer;
			  layer.msg('修改成功，即将返回登入页面！', {
				  icon: 1,
				  time: 2000 //2秒关闭（如果不配置，默认是3秒）
				}, function(){
				  //do something
				  location.href="login.jsp";
				});  
			}); 			      
	</script>
 <% 
  }%>
  
  	<!-- 修改失败弹窗提示1 -->
	<% if(request.getAttribute("defeat")!=null){
	  %>
	  <script type="text/javascript">
	  layui.use('layer', function(){
		  var layer = layui.layer;
		  layer.msg('修改失败，旧密码输入错误！');
		});  

	</script>
 <% 
  }%>
  
  <!-- 修改失败弹窗提示2 -->
	<% if(request.getAttribute("defeat2")!=null){
	  %>
	  <script type="text/javascript">
	  layui.use('layer', function(){
		  var layer = layui.layer;
		  layer.msg('修改失败，两次新密码不一致！');
		});  

	</script>
 <% 
  }%>
  
   <!-- 修改失败弹窗提示3 -->
	<% if(request.getAttribute("defeat3")!=null){
	  %>
	  <script type="text/javascript">
	  layui.use('layer', function(){
		  var layer = layui.layer;
		  layer.msg('修改失败,密码长度不符合规则！');
		});  

	</script>
 <% 
  }%>
</html>
